package com.t235.gc.auth.controller;

import com.t235.gc.AjaxResult;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.security.Principal;

@RestController
@RequestMapping("/users")
@CrossOrigin
public class UserController {

    @GetMapping("/me")
    public Object me(Principal principal) {
        return principal;
    }

    @GetMapping("/he")
    public AjaxResult he() {
        return AjaxResult.success("成功");
    }
}
